************
***Religion*
************


use "Datasets/PEWreligion.dta", clear
*********
***GWNO**
*********

capture drop gwno
gen gwno=.

replace gwno= 	700	if country==	"Afganistan"
replace gwno= 	700	if country==	"Afghanistan"
replace gwno= 	700	if country==	"AFGHANISTAN"
replace gwno= 	339	if country==	"Albania"
replace gwno= 	615	if country==	"Algeria"
replace gwno= 	232	if country==	"Andorra"
replace gwno= 	540	if country==	"Angola"
replace gwno= 	58	if country==	"Antigua & Barbuda"
replace gwno= 	58	if country==	"Antigua and Barbuda"
replace gwno= 	160	if country==	"Argentina"
replace gwno= 	371	if country==	"Armenia"
replace gwno= 	900	if country==	"Australia"
replace gwno= 	305	if country==	"Austria"
replace gwno= 	300	if country==	"Austria-Hungary"
replace gwno= 	373	if country==	"Azerbaijan"
replace gwno= 	267	if country==	"Baden"
replace gwno= 	31	if country==	"Bahamas"
replace gwno= 	31	if country==	"Bahamas, The"
replace gwno= 	692	if country==	"Bahrain"
replace gwno= 	692	if country==	"Bahrein"
replace gwno= 	771	if country==	"Bangladesh"
replace gwno= 	53	if country==	"Barbados"
replace gwno= 	245	if country==	"Bavaria"
replace gwno= 	370	if country==	"Belarus"
replace gwno= 	370	if country==	"Belarus (Byelorussia)"
replace gwno= 	211	if country==	"Belgium"
replace gwno= 	80	if country==	"Belize"
replace gwno= 	434	if country==	"Benin"
replace gwno= 	760	if country==	"Bhutan"
replace gwno= 	145	if country==	"Bolivia"
replace gwno= 	346	if country==	"Bosnia"
replace gwno= 	346	if country==	"BOSNIA"
replace gwno= 	346	if country==	"Bosnia & Herzegovina"
replace gwno= 	346	if country==	"Bosnia and Herzegovina"
replace gwno= 	346	if country==	"Bosnia-Hercegovenia"
replace gwno= 	346	if country==	"Bosnia-Hercegovina"
replace gwno= 	346	if country==	"Bosnia-Herz"
replace gwno= 	346	if country==	"Bosnia-Herzegovina"
replace gwno= 	571	if country==	"Botswana"
replace gwno= 	140	if country==	"Brazil"
replace gwno= 	835	if country==	"Brunei"
replace gwno= 	835	if country==	"Brunei Darussalam"
replace gwno= 	355	if country==	"Bulgaria"
replace gwno= 	439	if country==	"Burkina Faso"
replace gwno= 	439	if country==	"Burkina faso"
replace gwno= 	439	if country==	"Burkina Faso (Upper Volta)"
replace gwno= 	439	if country==	"Upper Volta / Burkina Faso"
replace gwno= 	775	if country==	"Burma"
replace gwno= 	775	if country==	"BURMA"
replace gwno= 	775	if country==	"Burma (Myanmar)"
replace gwno= 	516	if country==	"Burundi"
replace gwno= 	402	if country==	"C. Verde Is."
replace gwno= 	811	if country==	"Cambodia"
replace gwno= 	811	if country==	"Cambodia (Kampuchea)"
replace gwno= 	471	if country==	"Cameroon"
replace gwno= 	471	if country==	"Cameroun"
replace gwno= 	20	if country==	"Canada"
replace gwno= 	402	if country==	"Cape Verde"
replace gwno= 	402	if country==	"Cape Verde Is"
replace gwno= 	402	if country==	"Cape Verde Is."
replace gwno= 	482	if country==	"Cent. Af. Rep."
replace gwno= 	482	if country==	"Central Afr. Rep."
replace gwno= 	482	if country==	"Central Afr.R."
replace gwno= 	482	if country==	"Central African Rep"
replace gwno= 	482	if country==	"Central African Republic"
replace gwno= 	482	if country==	"CENTRAL AFRICAN REP."
replace gwno= 	483	if country==	"Chad"
replace gwno= 	155	if country==	"Chile"
replace gwno= 	710	if country==	"China"
replace gwno= 	710	if country==	"China P Rep"
replace gwno= 	710	if country==	"China, PR"
replace gwno= 	710	if country==	"China Version 2"
replace gwno= 	100	if country==	"Colombia"
replace gwno= 	581	if country==	"Comoro Is."
replace gwno= 	581	if country==	"Comoro Islands"
replace gwno= 	581	if country==	"Comoros"
replace gwno= 	484	if country==	"Congo"
replace gwno= 	484	if country==	"Congo (Brazzaville, Republic of Congo)"
replace gwno= 	484	if country==	"Congo 'Brazzaville'"
replace gwno= 	484	if country==	"Congo (Brazzaville)"
replace gwno= 	484	if country==	"Congo, Republic of (Brazzaville)"
replace gwno= 	484	if country==	"Congo Brazzaville"
replace gwno= 	490	if country==	"Congo (Kinshasa)"
replace gwno= 	490	if country==	"Congo Kinshasa"
replace gwno= 	490	if country==	"Congo, Dem. R."
replace gwno= 	490	if country==	"Congo, Dem. Rep."
replace gwno= 	490	if country==	"Congo, Democratic Republic of"
replace gwno= 	490	if country==	"Democratic Republic of the Congo (Zaire, Congo-Kinshasha)"
replace gwno= 	490	if country==	"Congo, Democratic Republic"
replace gwno= 	490	if country==	"Congo, Democratic Republic of (Zaire)"
replace gwno= 	484	if country==	"Congo, Rep. Of"
replace gwno= 	484	if country==	"Congo, Republic of"
replace gwno= 	484	if country==	"Congo, Rep."
replace gwno= 	94	if country==	"Costa Rica"
replace gwno= 	94	if country==	"Costa rica"
replace gwno= 	94	if country==	"COSTARICA"
replace gwno= 	437	if country==	"Cote D'Ivoire"
replace gwno= 	437	if country==	"Cote d'Ivoire"
replace gwno= 	437	if country==	"Cote d`Ivoire"
replace gwno= 	437	if country==	"Cote dIvoire"
replace gwno= 	437	if country==	"Cote d'Ivoire (Ivory Coast)"
replace gwno= 	344	if country==	"Croatia"
replace gwno= 	40	if country==	"Cuba"
replace gwno= 	352	if country==	"Cyprus"
replace gwno= 	352	if country==	"Cyprus (Greek)"
replace gwno= 	.	if country==	"Cyprus (Turkey)"
replace gwno= 	316	if country==	"Czech Rep"
replace gwno= 	316	if country==	"Czech Rep."
replace gwno= 	316	if country==	"Czech Republic"
replace gwno= 	316	if country==	"Czech Republic (Czechoslovakia)"
replace gwno= 	316	if country==	"CZECHREP"
replace gwno= 	315	if country==	"Czechoslovakia"
replace gwno= 	437	if country==	"CÙte d'Ivoire"
replace gwno= 	390	if country==	"Denmark"
replace gwno= 	522	if country==	"Djibouti"
replace gwno= 	42	if country==	"Dom. Rep."
replace gwno= 	54	if country==	"Dominica"
replace gwno= 	42	if country==	"Dominican Rep"
replace gwno= 	42	if country==	"Dominican rep."
replace gwno= 	42	if country==	"Dominican Rep."
replace gwno= 	42	if country==	"Dominican Republic"
replace gwno= 	490	if country==	"DR Congo"
replace gwno= 	490	if country==	"D.R. Congo"

replace gwno= 	265	if country==	"East Germany"
replace gwno= 	860	if country==	"East Timor"
replace gwno= 	860	if country==	"East Timor (Timor-Leste)"
replace gwno= 	130	if country==	"Ecuador"
replace gwno= 	651	if country==	"Egypt"
replace gwno= 	651	if country==	"Egypt, Arab Rep."
replace gwno= 	651	if country==	"Egypt/UAR"
replace gwno= 	92	if country==	"El Salvador"
replace gwno= 	92	if country==	"El salvador"
replace gwno= 	411	if country==	"Eq. Guinea"
replace gwno= 	411	if country==	"Equatorial Guinea"
replace gwno= 	531	if country==	"Eritrea"
replace gwno= 	366	if country==	"Estonia"
replace gwno= 	530	if country==	"Ethiopia"
replace gwno= 	530	if country==	"Ethiopia (-1992)"
replace gwno= 	530	if country==	"Ethiopia (1993-)"
replace gwno=	530	if country==	"Ethiopia [from 1993]"
replace gwno=	530	if country==	"Ethiopia [up to 1993]"
replace gwno= 	260	if country==	"FRG/Germany"
replace gwno= 	987	if country==	"Federated States of Micronesia"
replace gwno= 	950	if country==	"Fiji"
replace gwno= 	375	if country==	"Finland"
replace gwno= 	220	if country==	"France"
replace gwno= 	265	if country==	"GDR"
replace gwno= 	481	if country==	"Gabon"
replace gwno= 	420	if country==	"Gambia"
replace gwno= 	420	if country==	"Gambia The"
replace gwno= 	420	if country==	"Gambia, The"
replace gwno= 	372	if country==	"Georgia"
replace gwno= 	265	if country==	"German Dem. Rep."
replace gwno= 	265	if country==	"GERMAN DEM. REP."
replace gwno= 	265	if country==	"German Democratic Republic"
replace gwno= 	260	if country==	"German Fed. Rep."
replace gwno= 	260	if country==	"German Federal Republic"
replace gwno= 	260	if country==	"Germany"
replace gwno= 	255	if country==	"Germany (Prussia)"
replace gwno= 	265	if country==	"Germany Dem Rep"
replace gwno= 	260	if country==	"Germany Fed Rep"
replace gwno= 	260	if country==	"GERMANYFED. REP."
replace gwno= 	260	if country==	"Germany, Federal Republic of"
replace gwno= 	265	if country==	"Germany, E."
replace gwno= 	265	if country==	"Germany, East"
replace gwno= 	265	if country==	"Germany East"
replace gwno= 	260	if country==	"Germany, W."
replace gwno= 	260	if country==	"Germany, West"
replace gwno= 	260	if country==	"Germany West"
replace gwno= 	255	if country==	"Germany/Prussia"
replace gwno= 	452	if country==	"Ghana"
replace gwno= 	99	if country==	"Great Colombia"
replace gwno= 	350	if country==	"Greece"
replace gwno= 	55	if country==	"Grenada"
replace gwno= 	90	if country==	"Guatemala"
replace gwno= 	438	if country==	"Guinea"
replace gwno= 	404	if country==	"Guinea Bissau"
replace gwno= 	404	if country==	"Guinea-Bissau"
replace gwno= 	404	if country==	"Guinea-biss"
replace gwno= 	404	if country==	"GUINEA BISSAU"
replace gwno= 	110	if country==	"Guyana"
replace gwno= 	41	if country==	"Haiti"
replace gwno= 	240	if country==	"Hanover"
replace gwno= 	41	if country==	"HaÔti"
replace gwno= 	275	if country==	"Hesse-Darmstadt (Ducal)"
replace gwno= 	273	if country==	"Hesse-Kassel (Electoral)"
replace gwno= 	91	if country==	"Honduras"
*replace gwno= 	710	if country==	"Hong Kong (China)"
replace gwno= 	310	if country==	"Hungary"
replace gwno= 	395	if country==	"Iceland"
replace gwno= 	750	if country==	"India"
replace gwno= 	850	if country==	"Indonesia"
replace gwno= 	850	if country==	"Indonesia (including Timor until 1999)"
replace gwno= 	630	if country==	"Iran"
replace gwno= 	630	if country==	"Iran (Persia)"
replace gwno= 	630	if country==	"Iran Islam Rep"
replace gwno= 	630	if country==	"Iran (Islamic Republic of)"
replace gwno= 	630	if country==	"Iran, Islamic Rep."
replace gwno= 	645	if country==	"Iraq"
replace gwno= 	205	if country==	"Ireland"
replace gwno= 	666	if country==	"Israel"
replace gwno= 	666	if country==	"Occupied Palestinian Territories"
replace gwno= 	325	if country==	"Italy"
replace gwno= 	325	if country==	"Italy/Sardinia"
replace gwno= 	437	if country==	"Ivory Coast"
replace gwno= 	437	if country==	"IVORY COAST"
replace gwno= 	51	if country==	"Jamaica"
replace gwno= 	740	if country==	"Japan"
replace gwno= 	663	if country==	"Jordan"
replace gwno= 	811	if country==	"Kampuchea"
replace gwno= 	750	if country==	"Kashmir"
replace gwno= 	705	if country==	"Kazakhstan"
replace gwno= 	501	if country==	"Kenya"
replace gwno= 	970	if country==	"Kiribati"
replace gwno= 	730	if country==	"Korea"
replace gwno= 	731	if country==	"Korea (North)"
replace gwno= 	731	if country==	"Korea North"
replace gwno= 	731	if country==	"N. KOREA"
replace gwno= 	731	if country==	"Korea, D.P.Rep."
replace gwno= 	731	if country==	"Korea, North"
replace gwno= 	731	if country==	"Korea, People's Republic of"
replace gwno= 	731	if country==	"Korea Dem P Rep"
replace gwno= 	731	if country==	"Korea, Dem. Rep."
replace gwno= 	731	if country==	"Korea, Democratic People's Republic"
replace gwno= 	732	if country==	"Korea Rep"
replace gwno= 	732	if country==	"Korea (South)"
replace gwno= 	732	if country==	"Korea South"
replace gwno= 	732	if country==	"KOREA, S."
replace gwno= 	732	if country==	"Korea, Rep."
replace gwno= 	732	if country==	"Korea, Rep. Of"
replace gwno= 	732	if country==	"Korea, Rep. of"
replace gwno= 	732	if country==	"Korea, Republic Of"
replace gwno= 	732	if country==	"Korea, Republic of"
replace gwno= 	732	if country==	"Korea, South"
replace gwno= 	347	if country==	"Kosovo"
replace gwno= 	690	if country==	"Kuwait"
replace gwno= 	703	if country==	"Kyrgyszstan"
replace gwno= 	703	if country==	"Kyrgyz Republic"
replace gwno= 	703	if country==	"Kyrgyzstan"
replace gwno= 	812	if country==	"Lao P Dem Rep"
replace gwno= 	812	if country==	"Lao PDR"
replace gwno= 	812	if country==	"Lao People's Democratic Republic"
replace gwno= 	812	if country==	"Laos"
replace gwno= 	812	if country==	"Lao"
replace gwno= 	367	if country==	"Latvia"
replace gwno= 	660	if country==	"Lebanon"
replace gwno= 	570	if country==	"Lesotho"
replace gwno= 	450	if country==	"Liberia"
replace gwno= 	620	if country==	"Libya"
replace gwno= 	620	if country==	"Libya Arab Jamahiriy"
replace gwno= 	620	if country==	"Libyan Arab Jamah"
replace gwno= 	620	if country==	"Libyan Arab Jamahiriya"
replace gwno= 	223	if country==	"Liechtenstein"
replace gwno= 	368	if country==	"Lithuania"
replace gwno= 	212	if country==	"Luxembourg"
replace gwno= 	212	if country==	"Luxemburg"
replace gwno= 	343	if country==	"Macedonia"
replace gwno= 	343	if country==	"Macedonia (Former Yugoslav Republic of)"
replace gwno= 	343	if country==	"Macedonia FRY"
replace gwno= 	343	if country==	"Macedonia, FYR"
replace gwno= 	343	if country==	"FYR Macedonia"
replace gwno= 	343	if country==	"The former Yugoslav Republic of Macedonia"
replace gwno= 	580	if country==	"Madagascar"
replace gwno= 	580	if country==	"Madagascar (Malagasy)"
replace gwno= 	553	if country==	"Malawi"
replace gwno= 	820	if country==	"Malaysia"
replace gwno= 	781	if country==	"Maldive Islands"
replace gwno= 	781	if country==	"Maldives"
replace gwno= 	432	if country==	"Mali"
replace gwno= 	338	if country==	"Malta"
replace gwno= 	432	if country==	"Marli"
replace gwno= 	983	if country==	"Marshall Is"
replace gwno= 	983	if country==	"Marshall Islands"
replace gwno= 	435	if country==	"Mauritania"
replace gwno= 	590	if country==	"Mauritius"
replace gwno= 	590	if country==	"Mauritus"
replace gwno= 	280	if country==	"Mecklenburg-Schwerin"
replace gwno= 	70	if country==	"Mexico"
replace gwno= 	987	if country==	"Micronesia"
replace gwno= 	987	if country==	"Micronesia Fed States"
replace gwno= 	987	if country==	"Micronesia, Fed Stat"
replace gwno= 	332	if country==	"Modena"
replace gwno= 	359	if country==	"Moldova"
replace gwno= 	359	if country==	"Moldova Rep"
replace gwno= 	359	if country==	"Moldova, Republic Of"
replace gwno= 	359	if country==	"Republic of Moldova"
replace gwno= 	221	if country==	"Monaco"
replace gwno= 	712	if country==	"Mongolia"
replace gwno= 	341	if country==	"Montenegro"
replace gwno= 	600	if country==	"Morocco"
replace gwno=	600 if country==	"Western Sahara"
replace gwno= 	541	if country==	"Mozambique"
replace gwno= 	775	if country==	"Myanmar"
replace gwno= 	775	if country==	"Myanmar (Burma)"
replace gwno= 	565	if country==	"Namibia"
replace gwno= 	971	if country==	"Nauru"
replace gwno= 	790	if country==	"Nepal"
replace gwno= 	210	if country==	"Netherlands"
replace gwno= 	920	if country==	"New Zealand"
replace gwno= 	920	if country==	"New zealand"
replace gwno= 	93	if country==	"Nicaragua"
replace gwno= 	436	if country==	"Niger"
replace gwno= 	475	if country==	"Nigeria"
replace gwno= 	731	if country==	"North Korea"
replace gwno= 	385	if country==	"Norway"
replace gwno= 	698	if country==	"Oman"
replace gwno= 	564	if country==	"Orange Free State"
replace gwno= 	910	if country==	"P. N. Guinea"
replace gwno=	770	if country==	"Pakistan"
replace gwno=	770	if country==	"Pakistan (-1971)"
replace gwno=	770	if country==	"Pakistan (1972-)"
replace gwno= 	986	if country==	"Palau"
replace gwno= 	95	if country==	"Panama"
replace gwno= 	910	if country==	"Pap. New Guinea"
replace gwno= 	327	if country==	"Papal States"
replace gwno= 	910	if country==	"Papua New Guinea"
replace gwno= 	910	if country==	"Papua n.guinea"
replace gwno= 	910	if country==	"Papua New Guniea"
replace gwno= 	910	if country==	"PAPUA N.G."
replace gwno= 	150	if country==	"Paraguay"
replace gwno= 	335	if country==	"Parma"
replace gwno= 	135	if country==	"Peru"
replace gwno= 	840	if country==	"Philipines"
replace gwno= 	840	if country==	"Philippines"
replace gwno= 	840	if country==	"Phillippines"
replace gwno= 	290	if country==	"Poland"
replace gwno= 	235	if country==	"Portugal"
replace gwno= 	694	if country==	"Qatar"
replace gwno= 	360	if country==	"Romania"
replace gwno= 	360	if country==	"Rumania"
replace gwno= 	365	if country==	"Russia"
replace gwno= 	365	if country==	"Chechnya"
replace gwno= 	365	if country==	"Russia (Soviet Union)"
replace gwno= 	365	if country==	"Russia (USSR)"
replace gwno= 	365	if country==	"Russian Federation"
replace gwno= 	517	if country==	"Rwanda"
replace gwno= 	560	if country==	"S. Africa"
replace gwno= 	817	if country==	"S. Vietnam"
replace gwno= 	680	if country==	"S. Yemen"
replace gwno= 	60	if country==	"Saint Kitts and Nevis"
replace gwno= 	56	if country==	"Saint Lucia"
replace gwno= 	57	if country==	"Saint Vincent and the Grenadines"
replace gwno= 	57	if country==	"St. Vincent and the Grenadines"
replace gwno= 	990	if country==	"Samoa"
replace gwno= 	990	if country==	"Samoa (Western Samoa)"
replace gwno= 	990	if country==	"Western samoa"
replace gwno= 	990	if country==	"Samoa/Western Samoa"
replace gwno= 	331	if country==	"San Marino"
replace gwno= 	403	if country==	"Sao Tome & Principe"
replace gwno= 	403	if country==	"Sao Tome et Principe"
replace gwno= 	670	if country==	"Saudi Arabia"
replace gwno= 	670	if country==	"Saudi arabia"
replace gwno= 	269	if country==	"Saxony"
replace gwno= 	433	if country==	"Senegal"
replace gwno= 	345	if country==	"Serbia"
capture replace gwno= 	345	if country==	"Serbia & Montenegro" & year<2006
replace gwno= 	345	if country==	"Serbia (Yugoslavia)"
capture replace gwno= 	345	if country==	"Serbia Montenegro" & year<2006
capture replace gwno= 	345	if country==	"Serbia and Montenegro" & year<2006
capture replace gwno= 	345	if country==	"Serbia/Montenegro/Kosovo" & year<2006
replace gwno= 	591	if country==	"Seychelles"
replace gwno= 	451	if country==	"Sierra Leone"
replace gwno= 	451	if country==	"Sierra leone"
replace gwno= 	830	if country==	"Singapore"
replace gwno= 	317	if country==	"Slovak Rep"
replace gwno= 	317	if country==	"Slovak Republic"
replace gwno= 	317	if country==	"Slovakia"
replace gwno= 	349	if country==	"Slovenia"
replace gwno= 	940	if country==	"Solomon Is"
replace gwno= 	940	if country==	"Solomon is."
replace gwno= 	940	if country==	"Solomon Is."
replace gwno= 	940	if country==	"Solomon Islands"
replace gwno= 	520	if country==	"Somalia"
replace gwno= 	560	if country==	"South Africa"
replace gwno= 	560	if country==	"South africa"
replace gwno= 	732	if country==	"South Korea"
replace gwno= 	365	if country==	"Soviet Union"
replace gwno= 	230	if country==	"Spain"
replace gwno= 	780	if country==	"Sri Lanka"
replace gwno= 	780	if country==	`"Sri " Lanka"'
replace gwno= 	780	if country==	"Sri lanka"
replace gwno= 	780	if country==	"Sri Lanka (Ceylon)"
replace gwno= 	60	if country==	"St Kitts and Nevis"
replace gwno= 	56	if country==	"St Lucia"
replace gwno= 	56	if country==	"St.lucia"
replace gwno= 	57	if country==	"St Vincent and The Grenadines"
replace gwno= 	57	if country==	"St Vincent and the Grenadines"
replace gwno= 	60	if country==	"St. Kitts & Nevis"
replace gwno= 	60	if country==	"St.kitts&nevis"
replace gwno= 	60	if country==	"St. Kitts Nevis"
replace gwno= 	56	if country==	"St. Lucia"
replace gwno= 	56	if country==	"St. lucia"
replace gwno= 	57	if country==	"St. Vincent & Grenadine"
replace gwno= 	57	if country==	"St.vincent&gre"
replace gwno= 	57	if country==	"St. Vincent & Grenadines"
replace gwno= 	57	if country==	"St.Vincent & Grenadines"
replace gwno= 	57	if country==	"St. Vincent (and the grenadines)"
replace gwno= 	56	if country==	"St.Lucia"
replace gwno= 	625	if country==	"Sudan"
replace gwno= 	626	if country==	"South Sudan"
replace gwno= 	115	if country==	"Surinam"
replace gwno= 	115	if country==	"Suriname"
replace gwno= 	572	if country==	"Swaziland"
replace gwno= 	380	if country==	"Sweden"
replace gwno= 	225	if country==	"Switzerland"
replace gwno= 	652	if country==	"Syria"
replace gwno= 	652	if country==	"Syrian Arab Rep"
replace gwno= 	652	if country==	"Syrian Arab Republic"
replace gwno= 	403	if country==	"S„o TomÈ and Principe"
replace gwno= 	713	if country==	"Taiwan"
replace gwno= 	713	if country==	"Taiwan (China)"
replace gwno= 	702	if country==	"Tajikistan"
replace gwno= 	510	if country==	"Tanzania"
replace gwno= 	510	if country==	"Tanzania Uni Rep"
replace gwno= 	510	if country==	"Tanzania/Tanganyika"
replace gwno= 	510	if country==	"Tanzania - Mainland"
replace gwno= 	800	if country==	"Thailand"
replace gwno= 	711	if country==	"Tibet"
replace gwno= 	860	if country==	"Timor-Leste"
replace gwno= 	461	if country==	"Togo"
replace gwno= 	972	if country==	"Tonga"
replace gwno= 	563	if country==	"Transvaal"
replace gwno= 	52	if country==	"Trinidad & Tob."
replace gwno= 	52	if country==	"Trinidad & Tobago"
replace gwno= 	52	if country==	"Trinidad&tobago"
replace gwno= 	52	if country==	"Trinidad and Tobago"
replace gwno= 	52	if country==	"Trinidad-Tobago"
replace gwno= 	52	if country==	"Trinidad &Tobago"
replace gwno= 	616	if country==	"Tunisia"
replace gwno= 	.	if country==	"Turk Cyprus"
replace gwno= 	640	if country==	"Turkey"
replace gwno= 	640	if country==	"Turkey (Ottoman Empire)"
replace gwno= 	640	if country==	"Turkey/Ottoman Empire"
replace gwno= 	701	if country==	"Turkmenistan"
replace gwno= 	337	if country==	"Tuscany"
replace gwno= 	973	if country==	"Tuvalu"
replace gwno= 	329	if country==	"Two Sicilies"
replace gwno= 	696	if country==	"UAE"
replace gwno= 	200	if country==	"UK"
replace gwno= 	200	if country==	"U.K."
replace gwno= 	2	if country==	"USA"
replace gwno= 	2	if country==	"U.S.A."
replace gwno= 	365	if country==	"USSR"
replace gwno= 	365	if country==	"U.S.S.R." 
replace gwno= 	500	if country==	"Uganda"
replace gwno= 	500	if country==	"Ugandan"
replace gwno= 	369	if country==	"Ukraine"
replace gwno= 	696	if country==	"Unit. Arab Em."
replace gwno= 	696	if country==	"United arab e."
replace gwno= 	696	if country==	"United Arab Emirates"
replace gwno= 	696	if country==	"U. ARAB EMIRATES"
replace gwno= 	200	if country==	"United Kingdom"
replace gwno= 	89	if country==	"United Provinces of Central America"
replace gwno= 	2	if country==	"United States"
replace gwno= 	2	if country==	"United States of America"
replace gwno= 	165	if country==	"Uruguay"
replace gwno= 	704	if country==	"Uzbekistan"
replace gwno= 	935	if country==	"Vanuatu"
replace gwno= 	101	if country==	"Venezuela"
replace gwno= 	101	if country==	"Venezuela, RB"
replace gwno= 	816	if country==	"Viet Nam"
replace gwno= 	816	if country==	"Vietnam"
replace gwno= 	815	if country==	"Vietnam (Annam/Cochin China/Tonkin)"
replace gwno= 	816	if country==	"Vietnam, Dem. Rep."
replace gwno= 	816	if country==	"Vietnam, Democratic Republic of"
replace gwno= 	816	if country==	"Vietnam, Socialist Republic of"
replace gwno= 	816	if country==	"Vietnam, N."
replace gwno= 	816	if country==	"Vietnam, North"
replace gwno= 	816	if country==	"Vietnam North"
replace gwno= 	817	if country==	"Vietnam, Rep. of"
replace gwno= 	817	if country==	"Vietnam, Republic of"
replace gwno= 	817	if country==	"Vietnam, Republic of (South Vietnam)"
replace gwno= 	817	if country==	"Vietnam, S."
replace gwno= 	817	if country==	"VIETNAM, S."
replace gwno= 	817	if country==	"Vietnam, South"
replace gwno= 	817	if country==	"Vietnam South"
replace gwno= 	990	if country==	"W. Samoa"
replace gwno= 	271	if country==	"W¸rttemberg"
replace gwno= 	678	if country==	"Yemen"
replace gwno= 	678	if country==	"Yemen (AR)"
replace gwno= 	678	if country==	"Yemen (Arab Republic of Yemen)"
replace gwno= 	680	if country==	"Yemen (PDR)"
replace gwno= 	680	if country==	"Yemen PDR (South)" 
replace gwno= 	678	if country==	"Yemen Arab Rep"
replace gwno= 	678	if country==	"Yemen Arab Rep."
replace gwno= 	678	if country==	"YEMEN ARAB REP."
replace gwno= 	678	if country==	"Yemen, Rep."
replace gwno=	678	if country==	"Yemen Arab Republic [former]"
replace gwno=	678	if country==	"Yemen Arab Republic" 
replace gwno= 	680	if country==	"Yemen P Dem Rep"
replace gwno= 	680	if country==	"Yemen Peoples Rep."
replace gwno= 	680	if country==	"YEMEN PEOP. REP."
replace gwno= 	678	if country==	"Yemen, N."
replace gwno= 	678	if country==	"Yemen, North"
replace gwno= 	678	if country==	"Yemen North"
replace gwno= 	680	if country==	"Yemen, South"
replace gwno= 	680	if country==	"Yemen South"
replace gwno= 	678	if country==	"Yemen, Republic of"
replace gwno= 	680	if country==	"Yemen, People's Republic of"
replace gwno= 	680	if country==	"Yemen, People's Democratic Republic of"
replace gwno= 	680	if country==	"Yemen, S."
replace gwno= 	345	if country==	"Yugoslavia"
replace gwno= 	345	if country==	"YUGOSLAVIA"
replace gwno= 	345	if country==	"Yugoslavia/Serbia"
replace gwno= 	345	if country==	"Yugoslavia (Serbia and Montenegro)"
replace gwno= 	345	if country==	"Yugoslavia, Fed. Rep."
replace gwno= 	490	if country==	"Zaire"
replace gwno= 	490	if country==	"Zaire (Congo Kinshasa)"
replace gwno= 	490	if country==	"Zaire (Congo after 1997)"
replace gwno= 	490	if country==	"Zaire (Democ Republic Congo)"
replace gwno= 	490	if country==	"Zaire/Congo Dem Rep"
replace gwno=	490	if country==	"Democratic Republic of the Congo"
replace gwno=	490	if country==	"DEM. REP. CONGO"
replace gwno= 	551	if country==	"Zambia"
replace gwno= 	511	if country==	"Zanzibar"
replace gwno= 	552	if country==	"Zimbabwe"
replace gwno= 	552	if country==	"Zimbabwe (Rhodesia)"
replace gwno=	437	if country==	"Cote díIvoire"
replace gwno= 	490	if country==	"Democratic Republic of Congo (Zaire)"
replace gwno= 	580	if country==	"Malagasy Republic"
replace gwno= 	52	if country==	"Trinidad"
replace gwno= 	434	if country==	"Benin/Dahomey"
replace gwno= 	434	if country==	"Benin (Dahomey)"
replace gwno= 	580	if country==	"Malagasy"


capture replace gwno=	340	if country== "Serbia" & year<=1915
replace gwno= 	490	if country== "Congo, DR"
replace gwno= 	731	if country== "Korea, DPR"
replace gwno= 	.	if country== "New Caledonia"
replace gwno= 	345	if country== "Serbia & Montenegro"
replace gwno= 	345	if country== "Serbia and Montenegro"
replace gwno=	345	if country== "Serbia *"
replace gwno= 	260	if country== "West Germany"

drop if gwno == .
drop if country == "Western Sahara"
replace gwno = 817 if gwno == 816
replace gwno = 680 if gwno == 678
rename majorityreligion religion
replace religion = "1" if religion == "Christian"
replace religion = "2" if religion == "Islam"
replace religion = "3" if religion == "Buddhist"
replace religion = "4" if religion == "Hindu"
replace religion = "5" if religion == "Jewish"
replace religion = "6" if religion == "Folk religion"
replace religion = "7" if religion == "Unaffiliated"
destring religion, replace

save "Datasets/PEWreligion_gwno.dta", replace


